package com.duofan.gmall.common.utils;

import java.util.HashMap;
import java.util.Map;

/**
 * RabbitMQ工具类
 */
public class MyRabbitUtils {

    /**
     * 构造死信队列参数
     * @param exchange
     * @param routingKey
     * @param ttl
     * @return
     */
    public static Map<String, Object> buildDeadLetterArgs(String exchange, String routingKey, int ttl) {
        Map<String, Object> args = new HashMap<>();
        args.put("x-dead-letter-exchange", exchange);
        args.put("x-dead-letter-routing-key", routingKey);
        args.put("x-message-ttl", ttl);
        return args;
    }

}
